﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using AbstractFramework.Display;
using AbstractFramework;

namespace ControlLib
{
    /// <summary>
    /// Interaction logic for FloorIndicator.xaml
    /// </summary>
    public partial class InsideIndicatorDisplay : UserControl, IInsideIndicatorDisplay
    {
        public InsideIndicatorDisplay()
        {
            InitializeComponent();
            this.showRestroom(0);
        }

        public void showText(string text)
        {
            txtCurrentFloor.Text = text;
        }
        
        public void showMovementStatus(MovementStatus state)
        {
            if (state == MovementStatus.Stoped)
            {
                txtDownIcon.Visibility = Visibility.Hidden;
                txtUpIcon.Visibility = Visibility.Hidden;
            }
            else if (state == MovementStatus.DownMoving)
            {
                txtDownIcon.Visibility = Visibility.Visible;
                txtUpIcon.Visibility = Visibility.Hidden;
            }
            else if (state == MovementStatus.UpMoving)
            {
                txtDownIcon.Visibility = Visibility.Hidden;
                txtUpIcon.Visibility = Visibility.Visible;
            }
        }

        public void showRestroom(int restRoom)
        {
            txtRestRoom.Text = String.Format("剩余空间{0}人", restRoom);
        }
    }
}
